#include<iostream>
#include<string>
using namespace std;
int flag_a(string str)
{
	int num = str.length();
	//int find_a = 0;
	for (int i = 0;i < num;i++)
	{
		if (str[i] != 'a')
		{
			//find_a = i;
			//cout << i-1 << endl;

			return i-1;
		}
	}
	return num;
}
int flag_b(string str)
{
	int num = str.length();
	//int find_b = num - 1;
	for (int i = num - 1;i > 0;i--)
	{
		if (str[i] != 'b')
		{
			//find_b = i;
			//cout << i << endl;
			return i;
		}
	}
	return 0;
}
int main()
{
	string str;
	cin >> str;
	int num = str.length();
	int num_a = flag_a(str);
	int num_b = flag_b(str);
	if (num_a == num)
	{
		cout << "True";
	}
	else if (num_b == 0)
	{
		cout << "True";
	}
	else if ((num_a) == (num_b))
	{
		cout << "True";
	}
	else if((num_a) != (num_b))
	{
		cout << "False";
	}
	return 0;
}